﻿namespace BlazorWebassemblyApp.DataModel;

public class Student
{
    #region 属性

    /// <summary>
    /// 学号
    /// </summary>
    public int Id { get; set; }

    /// <summary>
    /// 姓名
    /// </summary>
    public string Name { get; set; }

    /// <summary>
    /// 年龄
    /// </summary>
    public int Age { get; set; }

    /// <summary>
    /// 性别
    /// </summary>
    public string Sex { get; set; }

    /// <summary>
    /// 班级名称
    /// </summary>
    public string ClassName { get; set; }

    /// <summary>
    /// 入学时间
    /// </summary>
    public DateTime? JoinDateTime { get; set; }

    /// <summary>
    /// 国家
    /// </summary>
    public string Coutry { get; set; }

    /// <summary>
    /// 省份
    /// </summary>
    public string Province { get; set; }

    /// <summary>
    /// 城市
    /// </summary>
    public string City { get; set; }

    /// <summary>
    /// 地址
    /// </summary>
    public string Address { get; set; }

    #endregion


    #region 方法

    /// <summary>
    /// 构建测试数据
    /// </summary>
    /// <returns></returns>
    public static List<Student> ConstructStudentList()
    {
        List<Student> studentList = new List<Student>();

        for (int i = 1; i < 101; i++)
        {
            Student student = new Student()
            {
                Id = i,
                Name = $"学生{i}",
                Age = 16,
                Sex = i % 2 == 0 ? "男" : "女",
                ClassName = $"高一({i})班",
                JoinDateTime = Convert.ToDateTime("2021-08-31"),
                Coutry = "中华人民共和国",
                Province = "广东省",
                City = "广州市",
                Address = "天河区凤凰街道柯木塱榄排街36号菜鸟驿站"
            };

            studentList.Add(student);
        }

        return studentList;
    }

    #endregion
}